#! /bin/bash



total=31;
a=7;
b=24;

for exe in  1d-jacobi-3p
do
    rm result/$exe.txt
    for index in `seq $a $b`;
    do 
    nx=$((2 ** $index))
    t=$((2 ** ($total - $index)))
    ../$exe/exe-$exe $nx $t >> result/$exe.txt 
    done
done
echo -e "size\tscalar\tauto\tvectime_stride7\tvectime_stride11\tour\tvectime_transpose_inout\tdlt_unroll1\tdlt_unroll2\tdlt_unroll4\tmultiload_unroll1\tmultiload_unroll2\tmultiload_unroll4\treg_assemble_unroll1\treg_assemble_unroll2\treg_assemble_unroll4" > result/$exe.data.txt
cat result/1d-jacobi-3p.txt|tr "," "=" | awk -F "= " '{print $3 "\t" $NF}'|paste - - - - - - - - - - - - - - -|awk '{print $1"\t" $2"\t" $4"\t" $6"\t"$8"\t" $10"\t" $12"\t"$14"\t" $16"\t" $18"\t"$20"\t" $22"\t" $24"\t"$26"\t" $28"\t" $30"\t"}' >> result/1d-jacobi-3p.data.txt